﻿Public Class ChuyenBay_HangVe
    Inherits DataProvider

    Public Function lay_dataset() As DataSet
        Dim sqlstr As String = "SELECT * FROM ChuyenBay_HangVe"
        Return GetDT(sqlstr)
    End Function

    Public Function Insert(ByVal dto_cb_hv As DTO.ChuyenBay_HangVe)
        Dim sql_query As String = "INSERT INTO ChuyenBay_HangVe(ChuyenBay, HangVe, SoLuongGhe, DonGia) VALUES( " + dto_cb_hv.chuyenbay + ", " + dto_cb_hv.hangve + ", " + dto_cb_hv.soluongghe + ", " + dto_cb_hv.dongia + ")"
        If IsNothing(Me.SaveData(sql_query)) Then
            Return Nothing
        End If
        Dim id As Integer = Integer.Parse(GetValue("SELECT max(id) from ChuyenBay_HangVe"))
        Return id
    End Function

End Class
